/*
 * Energia_Cinetica.h
 *
 *  Created on: 03/09/2013
 *      Author: steiner
 */

#ifndef ENERGIA_CINETICA_H_
#define ENERGIA_CINETICA_H_

double Energia_Cinetica(long, double*, double*);

#endif /* ENERGIA_CINETICA_H_ */



#include <math.h>

void Energia_Cinetica(long n, double *p, double *kin, double *mass){

	int i;

	for (i = 0 ; i < n ; i++) {
		*kin += (p[i]*p[i])/(mass[i]);
	}
	*kin = *kin / ( (double) n*2.);

	return;
}

